/**
 * Copyright 2020 OPSLI 快速开发平台 https://www.opsli.com
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.opsli.modulars.business.patrolRouteRecord.service.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.opsli.api.wrapper.business.patrolRouteRecord.PatrolRouteRecordModel;
import org.opsli.modulars.business.routeStation.entity.RouteStation;
import org.opsli.modulars.business.routeStation.mapper.RouteStationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.opsli.core.base.service.impl.CrudServiceImpl;

import org.opsli.modulars.business.patrolRouteRecord.entity.PatrolRouteRecord;
import org.opsli.modulars.business.patrolRouteRecord.service.IPatrolRouteRecordService;
import org.opsli.modulars.business.patrolRouteRecord.mapper.PatrolRouteRecordMapper;

import java.util.List;


/**
 * 巡线记录 Service Impl
 *
 * @author zk
 * @date 2021-09-16 15:12:07
 */
@Service
public class PatrolRouteRecordServiceImpl extends CrudServiceImpl<PatrolRouteRecordMapper, PatrolRouteRecord, PatrolRouteRecordModel>
    implements IPatrolRouteRecordService {

    @Autowired(required = false)
    private PatrolRouteRecordMapper mapper;
    @Autowired(required = false)
    private RouteStationMapper stationMapper;

    @Override
    public PatrolRouteRecord findLast(String userid){
        return mapper.findLast(userid);
    }

    @Override
    public PatrolRouteRecord findLastHome(String userid){
        return mapper.findLastHome(userid);
    }

    @Override
    public List<RouteStation> findList(String routeid){
        return stationMapper.findList(routeid);
    }


    @Override
    public List<PatrolRouteRecord> getTodayList(PatrolRouteRecord announcementSendModel){
        return mapper.getTodayList(announcementSendModel);
    }


    @Override
    public  int updateOne(String userId){
        return mapper.updateOne(userId);
    }


    @Override
    public PatrolRouteRecord getOne(String sign){
        return mapper.getOne(sign);
    }


    @Override
    public Page<PatrolRouteRecord> getMyList( Page< PatrolRouteRecord> page, PatrolRouteRecord announcementSendModel,Integer beginSize,Integer endSize){
        return page.setRecords(mapper.getMyList(announcementSendModel,beginSize,endSize));
    }

    @Override
    public Page<PatrolRouteRecord> getMyListNew(Page<PatrolRouteRecord> page, PatrolRouteRecord announcementSendModel, Integer beginSize, Integer endSize) {
        return page.setRecords(mapper.getMyListNew(announcementSendModel,beginSize,endSize));
    }

    @Override
    public int deleteStation( String sign){
        return mapper.deleteStation(sign);
    }

    @Override
    public List<PatrolRouteRecord> getWeekList(String devid){
        return mapper.getWeekList(devid);
    }

}
